






<div class="admin-biaogelist">

    <div class="listbiaoti am-cf">
        <ul class="am-icon-flag on"> 客户消费详情</ul>

        <dl class="am-icon-home" style="float: right;">当前位置： 首页 > <a href="#">客户消费详情</a></dl>

        <!--<dl>
          <button type="button" class="am-btn am-btn-danger am-round am-btn-xs am-icon-plus" > 补充线订单</button>
        </dl>-->
        <!--这里打开的是新页面-->

    </div>

    <div class="fbneirong">
        <form class="am-form am-g">
            <div class="searchbox">
              <!--  <p  class="allmomey" style="margin-left: 20px; float: left">
                    今日任务总本金：0
                </p>-->


                <div class="searchbox_box">
                    <div  class="searchbox_text"> 开始时间：</div>
                    <div  class="searchbox_input"> <input type="text" class="datapick datapick1"   name="date1"> </div>
                </div>

                <div class="searchbox_box">
                    <div  class="searchbox_text"> 结束时间：</div>
                    <div  class="searchbox_input"><input type="text"   name="date2" class="datapick datapick2" > </div>
                </div>



                <div class="searchbox_box">
                        <div  class="searchbox_text"> 类型：</div>
                        <div  class="searchbox_input">    <select name="typelist" >
                                <?Php   foreach ($typelist as $id=>$v){?>
                                    <option  value="<?php  echo$id;  ?>"><?php  echo$v;  ?></option>
                                <?php } ?>
                            </select> </div>
                </div>

                  <div class="searchbox_box">

            <div  class="searchbox_input"><input type="text" name="username"  placeholder="用户名"> </div>
            </div>
                <div class="searchbox_box">

                    <div  class="searchbox_input"><input type="text" name="recommender" placeholder="推荐人" > </div>
                </div>


                <div class="searchbox_box">
                    <div class="search_button  search  am-btn am-btn-secondary "> <img src="<?php echo base_url();?>/public/assets/image/chazhao.png">查询 </div>
                </div>
                <div class="searchbox_box">
                  <div class="search_button am-btn am-btn-secondary "><img src="<?php echo base_url();?>/public/assets/image/daochu.png"> <a  class="excelout" href="<?php echo base_url()."/Customer/businesspaylogexcel/0/0/0/0"?>">导出数据</a>  </div>
                   </div>



             <!--   <p style=" float: left" > <a   style="margin-left: 20px;" class="am-btn am-btn-secondary am-radius excelout"  href="<?php /*echo base_url()."/Customer/businesspaylogexcel/0/0/0"*/?>">导出</a></p>-->


            </div>
            <table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped am-table-hover">
                <thead>
                <tr class="am-success">
                    <th class="table-check"><input type="checkbox" /></th>

                    <th class="table-id">ID</th>
                    <th class="table-title">类别</th>
                    <th class="table-title">用户名</th>
                    <th class="table-title">推荐人</th>
                    <th class="table-type">本金</th>
                    <th class="table-type">变动资金</th>
                    <th class="table-type">余额</th>
                    <th class="table-author am-hide-sm-only">原有金币</th>
                    <th class="table-author am-hide-sm-only">金币变动</th>
                    <th class="table-author am-hide-sm-only">剩余金币</th>
                    <th class="table-author am-hide-sm-only">任务单量</th>
                    <th class="table-date am-hide-sm-only">时间</th>
                    <th class="table-date am-hide-sm-only">备注</th>
                </tr>
                </thead>
                <tbody class="impowdith">




                </tbody>
            </table>

            <!--  <div class="am-btn-group am-btn-group-xs">
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 删除</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 上架</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 下架</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 移动</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 新增</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 保存</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-archive"></span> 移动</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-trash-o"></span> 删除</button>
              </div>-->



            <div id="Pagination" style="margin:20px auto" style="display:none"></div>

            <!--  <ul class="am-pagination am-fr">


              </ul>-->




            <hr />
            <p>注：.....</p>
        </form>



    </div>



    <script>



        laydate.render({
            elem: '.datapick1'
        });
        laydate.render({
            elem: '.datapick2'
        });



        var on_request=false;
        var type=1;
        var page=1;


        var excelurl="";
        $("input[name='date1']").on("change",setexcelurl);
        $("input[name='date2']").on("change",setexcelurl);
        $("input[name='username']").on("change",setexcelurl);
        $("input[name='recommender']").on("change",setexcelurl);

        $("select[name='typelist']").on("change",setexcelurl);



        function setexcelurl() {


            var date1=$("input[name='date1']").val();
            var date2=$("input[name='date2']").val();
            var username=$("input[name='username']").val();
            var type=$("select[name='typelist']").val();
            var recommender=$("input[name='recommender']").val();


            if(date1==""){
                date1="0";
            }
            if(date2==""){
                date2="0";
            }
            if(username==""){
                username="0";
            }
            if(recommender==""){
                recommender="";
            }


            if(type==""){
                type="0";
            }


            excelurl="<?php echo base_url(); ?>/Customer/businesspaylogexcel"+"/"+date1+"/"+date2+"/"+username+"/"+type+"/"+recommender;
            $(".excelout").attr("href",excelurl);

        }


   $(".search").click(function () { page=1;
            getpaylog();

        });




        function setlisthtnml(data) {
            var html = "";

            if (data.list.length > 0) {
                $.each(data.list, function (key, value) {
                    html = html +
                        '<tr ><td><input type="checkbox" /></td>\n' +
                        '<td>' + value.id + '</td>\n' +
                        '<td>' + value.type + '</td>\n' +
                        '<td>' + value.username + '</td>\n' +
                        '<td>' + value.recommender + '</td>\n' +
                        '<td>' + value.capital + '</td>\n' +
                        '<td>' + value.money + '</td>\n' +
                        '<td>' + value.balance + '</td>\n' +
                        '<td>' + value.capital_gold + '</td>\n' +
                        '<td>' + value.gold + '</td>\n' +
                        '<td>' + value.balance_gold + '</td>\n' +
                        '<td>' + value.number + '</td>\n' +
                        '<td>' + value.addtime + '</td>\n' +
                        '<td>' + value.remarks + '</td>\n' +

                        '</tr>';
                });
                $(".impowdith").html(html);
                $('#Pagination').show();


            } else {
                html += '<li><div style="width:100%;text-align:center;">&nbsp暂无数据</div></li>';
                $(".impowdith").html(html);
                $('#Pagination').hide();
            }
        }

        getpaylog();

        function getpaylog() {
            var url = "<?php echo base_url(); ?>/Customer/getbusinesspaylog";

            var date1=$("input[name='date1']").val();
            var date2=$("input[name='date2']").val();
            var username=$("input[name='username']").val();
            var recommender=$("input[name='recommender']").val();
            var type=$("select[name='typelist']").val();
            var postdata = {
                'page': page,
                'date1': date1,
                'date2': date2,
                'type': type,
                'username': username,
                'recommender': recommender,
                'epage': 13
            };



            $.post(url, postdata, function (data) {
                on_request = false;
                setlisthtnml(data);
                $(".allmomey").html("今日任务总本金："+data.allmoney);

                setPagination("Pagination", data.count, page, data.epage, function (clickPage) {
                    page = parseInt(clickPage) + 1;
                    getpaylog();
                });
            }, 'json');

        }






    </script>








    <div class="foods">
        <ul>
            版权所有@2015.
        </ul>
        <dl>
            <a href="" title="返回头部" class="am-icon-btn am-icon-arrow-up"></a>
        </dl>
    </div>




</div>

</div>




</div>


<!--<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>-->
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/polyfill/rem.min.js"></script>
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/polyfill/respond.min.js"></script>
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/amazeui.legacy.js"></script>


<!--[if (gte IE 9)|!(IE)]><!-->
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/amazeui.min.js"></script>
<!--<![endif]-->



</body>
</html>